﻿using AuthTemplate.Entity;
using AuthTemplate.DTO;
using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AuthTemplate.DTO.User;

namespace AuthTemplate.Infrastructure.AutoMapper.Profiles
{
    public class UserProfile : Profile
    {
        public UserProfile()
        {
            CreateMap<User, UserDto>()
                .ForMember(dest => dest.Name, map => map.MapFrom(src => src.Name))
                .ReverseMap();      //ReverseMap双向映射

            CreateMap<AddUserInput, User>()
                .ReverseMap();      //ReverseMap双向映射
        }
            
    }
}
